<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Array2Table div Demo</title>
<style type="text/css">
/*Basic  Formating from webexample*/
    .Table
    {
        display: table;
    }
    .Title
    {
        display: table-caption;
        text-align: center;
        font-weight: bold;
        font-size: larger;
    }
    .Heading
    {
        display: table-row;
        font-weight: bold;
        text-align: center;
        background:#cccccc;
    }
    .Footer
    {
        display: table-row;
        font-weight: bold;
        text-align: center;
        background:#ccffff;
    }
    .Row
    {
        display: table-row;
    }
    .Cell
    {
        display: table-cell;
        border: solid;
        border-width: thin;
        padding-left: 5px;
        padding-right: 5px;
    }
    
    
/*some extra color stuff*/
.att .rowtype-1{background:#ffeeff;}
.att .rowtype-2{background:#ffffee;}

.att .row-3 .col-3 {border:5px dotted green; background:#ff9999;}
.att .col-5 {border:1px dotted red; background:#ffaaaa;}

</style>
</head>

<body>
<h2>Using Divs</h2>
We are using the example from here:</br>
<a href="http://www.dummies.com/how-to/content/using-the-div-tag-to-create-tables.html">http://www.dummies.com/how-to/content/using-the-div-tag-to-create-tables.html</a>
</br> 
</br> 
This DIV example will probably not work on IE 7 and older.
(There are other ways in doing it IE compatible)</br> </br> 
This one is not the easiest solution, as the easiest would 
have been to rename the CSS classes (Header, Cell...) to the ones  </br> 
used in the default settings (hrow, hcol, col.....). </br> 
But here we show how to adapt the default classes to any stylesheet you like.</br> 
Another option would be to add the extra classes to the template.
<pre><code>
	class="Heading %1$s" %2$s 
	class="Cell %1$s" %2$s 
</code></pre>
<?php


//Anoter Dataarray whith first line filled whith header data, and last line filled whith footer Data.
$aData = array( 
				array("Name",   "Price", "Number", "Description", "letter", "number"),
               array("rose",   1.25 ,  15, "sometext", "A","1"),
               array("daisy",  0.75 ,  25, "moretext", "b","2"),
               array("orchid", 1.15 ,  7,  "evenmore", "b","3"),
               array("rose2",  1.25 ,  15, "sometext more more more more", "v","4"),
               array("daisy3", 0.75 ,  25, "moretext", "c","15"),
               array("orchid4",1.15 ,   7, "evenmore", "d","6"), 
               array("rose2",  1.25 ,  15, "sometext", "v","4"),
               array("daisy3", 0.75 ,  25, "moretext", "c","15"),
               array("orchid4",1.15 ,   7, "evenmore", "d","6"),
				array("fName",   "fPrice", "fNumber", "fDescription", "fletter", "fnumber"),

); 
 
$aData2 = array( 
              array("daisy3", 0.75 ,  25, "moretext", "c","15"),
               array("orchid4",1.15 ,   7, "evenmore", "d","6"), 
               array("rose2",  1.25 ,  15, "sometext", "v","4"),
               array("daisy3", 0.75 ,  25, "moretext", "c","15"),
               array("orchid4",1.15 ,   7, "evenmore", "d","6")
);   


// include the Script
include ("classes/arraytotable.php");

// create new tableobject
$oAtt=new ArrayToTable();

// set the main Data Array
$oAtt->aData =$aData;

// fetch header from first line of dataarray
$oAtt->sHeadAutoFetch = "first";
// fetch footer from last line
$oAtt->sFootAutoFetch = "last";

// this is no table template whith <thead> <tfoot> <tbody> order.
// its a Div Template whith header, body, footer order. 
$oAtt->bIsTableTemplate = false;

//for creating rows whith different colors
$oAtt->iMaxRowTypes=2;

// set caption
$oAtt->sCaption="Hallo Überschrift";

//for a full override just load an external one
$oAtt->sAlternativTemplate="templates/divtemplate.php";

//changing the default classes to match the CSS
$oAtt->sTableClass="Table";//default: 
$oAtt->sDefaultTrHeadClasses='Heading'; //default: 'hrow'
$oAtt->sDefaultTrFootClasses='Footer';//default: 'frow'
$oAtt->sDefaultTrClasses='Row';//default: 'row'
$oAtt->sDefaultTdClasses='Cell';//default: 'col'
$oAtt->sDefaultThClasses='Cell';//default: 'hcol'
$oAtt->sDefaultTdFootClasses='Cell';//default: 'fcol'
$oAtt->sCaptionClass = "Title";



// Do the actual job
echo ($oAtt->Create());

//Turn off autofetch to show another table whith same headers
$oAtt->sHeadAutoFetch = "";
$oAtt->sFootAutoFetch = "";

//set another datatable ,this time whithout headers
$oAtt->aData =$aData2;

//show again
echo ($oAtt->Create());



?>
</body>
</html>